package com.zyl.Ecs.common.domain.device.ext;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * @version v1.0
 * @ProjectName: Ecs
 * @Package: com.zyl.Ecs.common.domain.device.ext
 * @ClassName: SensorEcl
 * @Description TODO (传感器Ecl)缩略
 * @Author 翟玉龙
 * @Date 2024/12/7-10:26
 */
@Builder
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class SensorEcl {
    @JsonProperty("sensorId")
    private Integer sensorId;

    @JsonProperty("name")
    private String sensorName;

    public static SensorEcl toEcl(SensorExt sensorExt) {
        return SensorEcl.builder()
                .sensorId(sensorExt.getId())
                .sensorName(sensorExt.getName())
                .build();
    }
}
